var gfun = require("./fun");
var gquery = require("./query");
var ggetTemData = require("./getTemData");
var ggetMsg = require("./getMsg");



function route(pathname,req,res) {
  console.log("About to route a request for " + pathname);
  
 
 
  switch(pathname){
	  
	 case "/no" :
		 console.log("index OK");
		 break;
	 case "/fun" :
		 console.log("fun OK");
		 gfun.fun(req,res);
		 break;
	 case "/getTemData" :
		console.log("getTemData OK");
		ggetTemData.getTemData(req,res);
		break;
	case "/getMsg" :
		console.log("getMsg OK");
		ggetMsg.getMsg(req,res);
		break;
	 case "/query" :
		 console.log("query OK");
		 gquery.query(req,res);
		 
		 break;
	 default:
		res.writeHead(200, {"Content-Type": "text/plain"});
		res.write("Page is Erro!");
		res.end();
		 break;
	    
  }
  
  
  
  
  
}
 
exports.route = route;